package com.kaikeba.util;

import com.kaikeba.bean.Courier;
import com.kaikeba.bean.User;

import javax.servlet.http.HttpSession;
import java.sql.Statement;

/**
 * @Author: 平川
 * @Description:
 * @Date Created in 2021-07-31 15:05
 * @Modified By:
 */
public class UserUtil {
    public static String getUserName(HttpSession session){
        return (String)session.getAttribute("adminUsername");
    }
    public static String getUserPhone(HttpSession session){
        return "18888888888";
    }
    public static String getLoginSms(HttpSession session,String userphone) {
        return (String) session.getAttribute(userphone);
    }
    public static void setLoginSms(HttpSession session,String userphone,String code){
        session.setAttribute(userphone,code);
    }
    //用户的信息
    public static void setWxUser(HttpSession session, User user){
        session.setAttribute("wxUser",user);
    }
    public static User getWxUser(HttpSession session){
        return (User)session.getAttribute("wxUser");
    }
    //快递员的信息
    public static void setWxCourier(HttpSession session, Courier courier){
        session.setAttribute("wxCourier",courier);
    }
    public static Courier getWxCourier(HttpSession session){
        return (Courier)session.getAttribute("wxCourier");
    }
}
